<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the value of the specified configuration option for the tidy document</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="tidy.gethtmlver.html">tidy::getHtmlVer</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="tidy.getoptdoc.html">tidy::getOptDoc</a></div>
 <div class="up"><a href="class.tidy.html">tidy</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="tidy.getopt" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">tidy::getOpt</h1>
  <h1 class="refname">tidy_getopt</h1>
  <p class="verinfo">(PHP 5, PECL tidy &gt;= 0.5.2)</p><p class="refpurpose"><span class="refname">tidy::getOpt</span> -- <span class="refname">tidy_getopt</span> &mdash; <span class="dc-title">Returns the value of the specified configuration option for the tidy document</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-tidy.getopt-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><strong>tidy::getOpt</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$option</code></span>
   )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><strong>tidy_getopt</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.tidy.html" class="type tidy">tidy</a></span> <code class="parameter">$object</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$option</code></span>
   )</div>

  <p class="para rdfs-comment">
   Returns the value of the specified <em><code class="parameter">option</code></em> for the
   specified tidy <em><code class="parameter">object</code></em>.  
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-tidy.getopt-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">object</code></em></dt>

     <dd>

      <p class="para">
       The <a href="class.tidy.html" class="classname">Tidy</a> 对象。
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">option</code></em></dt>

     <dd>

      <p class="para">
       You will find a list with each configuration option and their types
       at: <a href="http://tidy.sourceforge.net/docs/quickref.html" class="link external">&raquo;&nbsp;http://tidy.sourceforge.net/docs/quickref.html</a>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-tidy.getopt-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the value of the specified <em><code class="parameter">option</code></em>.
   The return type depends on the type of the specified one. 
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-tidy.getopt-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3955">
    <p><strong>Example #1 <span class="function"><strong>tidy_getopt()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$html&nbsp;</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;!DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;HTML&nbsp;3.2//EN"&gt;<br />&lt;html&gt;&lt;head&gt;&lt;title&gt;Title&lt;/title&gt;&lt;/head&gt;<br />&lt;body&gt;<br /><br />&lt;p&gt;&lt;img&nbsp;src="img.png"&gt;&lt;/p&gt;<br /><br />&lt;/body&gt;&lt;/html&gt;'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$config&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'accessibility-check'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'alt-text'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'some&nbsp;text'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$tidy&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">tidy</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">parseString</span><span style="color: #007700">(</span><span style="color: #0000BB">$html</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /><br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOpt</span><span style="color: #007700">(</span><span style="color: #DD0000">'accessibility-check'</span><span style="color: #007700">));&nbsp;</span><span style="color: #FF8000">//integer<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOpt</span><span style="color: #007700">(</span><span style="color: #DD0000">'lower-literals'</span><span style="color: #007700">));&nbsp;</span><span style="color: #FF8000">//boolean<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOpt</span><span style="color: #007700">(</span><span style="color: #DD0000">'alt-text'</span><span style="color: #007700">));&nbsp;</span><span style="color: #FF8000">//string<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
int(3)
bool(true)
string(9) &quot;some text&quot;
</pre></div>
    </div>
   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="tidy.gethtmlver.html">tidy::getHtmlVer</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="tidy.getoptdoc.html">tidy::getOptDoc</a></div>
 <div class="up"><a href="class.tidy.html">tidy</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
